package com.leanyuan.publi.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.leanyuan.publi.domain.House;
import com.leanyuan.publi.dao.HouseMapper;
import com.leanyuan.publi.dto.Statisticsto;
import com.leanyuan.publi.service.HouseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 相亲相爱一家人
 * @since 2021-05-25
 */
@Service
public class HouseServiceImpl extends ServiceImpl<HouseMapper, House> implements HouseService {
    @Autowired
    HouseMapper houseMapper;
    @Override
    public Page<House> findAllp(Page<House> page, Integer id, String lname, String username) {
        return page.setRecords(houseMapper.findAll(page,id,lname,username));
    }

    @Override
    public Page<House> findAllp2(Page<House> page, Integer id, String lname, String username) {
        return page.setRecords(houseMapper.findAll2(page,id,lname,username));
    }

    @Override
    public int upd(House house) {
        return houseMapper.upd(house);
    }

    @Override
    public int ins(House house) {
        return houseMapper.ins(house);
    }

    @Override
    public int upd2(House house) {
        return houseMapper.upd2(house);
    }

    @Override
    public List<Statisticsto> findCount() {
        return houseMapper.findCount();
    }
}
